package com.ds.infra.rpc.example.weather.controller;

import com.ds.infra.rpc.example.api.WeatherService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 作用：
 *
 * @author WeiShaoying
 */
@RestController
@RequestMapping("/weather")
@RequiredArgsConstructor
public class WeatherController {

    private final WeatherService weatherService;

    @GetMapping("/get")
    public String getWeather(String city) {
        return weatherService.getWeather(city);
    }
}
